/**
 *
 */
package de.cbf.cam.dice.logic;

import de.cbf.cam.dice.entities.RollDefinitionSum;

/**
 * @author Nebelritter
 *
 */
public class DiceRollerSum extends DiceRoller{


	public static int rollSumDice(RollDefinitionSum definition){
		int result = 0;
		int diceSides = definition.getDiceSides();
		int number = definition.getNumberOfDice();
		for (int i = 0; i < number; i++) {
			int diceResult = rndGenerator.getRandomNumber(diceSides);
			result += diceResult+1;
		}
		result += definition.getBonus();
		return result;
	}
	public static int[] rollDice(RollDefinitionSum definition){
		int diceSides = definition.getDiceSides();
		int result[] = new int[definition.getNumberOfDice()];
		for (int i = 0; i < result.length; i++) {
			int diceResult = rndGenerator.getRandomNumber(diceSides);
			result[i] = diceResult+1;
		}
		return result;
	}
//========================
//    standard methods
//========================


//========================
// 	   private methods
//========================

//========================
// 	SHORT property access
//========================

//========================
//		getters
//========================

//========================
//		setters
//========================

//========================
//		listeners
//========================

}
